package com.ucampus.service;

import com.ucampus.dao.oS_foodsMapper;
import com.ucampus.entity.oS_foods;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 功能：
 * 作者： 启明星_Polaris
 * 日期：2025/1/6 下午3:37
 **/

@Service
public class oS_foodsServiceImpl implements oS_foodsService{

    @Autowired
    private oS_foodsMapper foodsMapper;

    @Override
    public List<oS_foods> getFoodsByPage(int page, int size) {
        int offset = (page - 1) * size; // 根据页数计算起始点
        return foodsMapper.selectFoodsWithPagination(size, offset);
    }
}
